\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q: How can I get
\b make
\b0 to recompile my program when I've only edited one of the .h files? I've changed the class by editing the interface file, but it thinks the program is up to date. \
\
Q: Is there an easy way to recursively trace all the header files that my source file depends on?\
\
A: You can, of course, fool
\b make
\b0 by typing\
\
\f1\fs24\fc1\cf1 touch foo.m\
\fs28\fc0\cf0 \
\f0 in a shell, before compiling, but that's not a very elegant solution. What you need is a
\b Makefile.dependencies
\b0 file. \
\
In NEXTSTEP Release 2, this can be easily generated by typing\
\
\f1\fs24\fc1\cf1 make depend\
\f0\fs28\fc0\cf0 \
in a shell, assuming your Makefile was generated by InterfaceBuilder. \
\
In NEXTSTEP Release 3.0, ProjectBuilder provides an "Args" textfield in the Builder inspector. Just type\
\
\f1\fs24\fc1\cf1 depend\
\f0\fs28\fc0\cf0 \
in a shell, to generate a Makefile.dependencies file. \
\
In NEXTSTEP Release 3.1, the user interface of ProjectBuilder has been further simplified. You just select "depend" as your Target for the Build operation. \
\
Makefile.dependencies contains all the dependencies, listing the files included by your .m files. A typical line of this file looks something like:\
\b0 in this directory, whether from InterfaceBuilder in NEXTSTEP Release 2, or from ProjectBuilder in NEXTSTEP Release 3, or a shell, it checks this file before deciding the program is up to date. Makefile.dependencies can also be edited by hand, if for any reason
\b make depend
\b0 doesn't do what you need. If you add new files to your project, you should delete Makefile.dependencies
\b
\b0 and regenerate it before recompiling. Note that ProjectBuilder in NEXTSTEP Release 3 is smart enough to
\i not
\i0 recompile your files in case only your interfaces file (.nib) has been modified. It just copied the nib.\
\
In answer to the second question,
\b cc
\b0 has a -M flag that can be useful if you want to see a listing of
\b all
\b0 the header files your source file depends on, including the AppKit and operating system files. See also the man page.\